home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / vsave200.zip / VGASAVE.DOC < prev    next >
Text File  |  1993-08-22  |  90KB  |  1,762 lines

  1.  
  2.  
  3.  
  4.  
  5.    VGAsave                    Version 2.00                      8/22/93
  6.    ====================================================================
  7.    Copyright (c) 1992, 1993     Bill Javurek
  8.    ====================================================================
  9.  
  10.  
  11.    System Requirements
  12.    ===================
  13.  
  14.    VGA.
  15.  
  16.  
  17.    Introduction to VGAsave
  18.    =======================
  19.  
  20.    VGAsave is yet another screen saver.  The design philosophy behind this
  21.    screen saver is twofold:
  22.  
  23.       1.  To use the smallest amount of memory possible.  VGAsave requires
  24.           400 bytes of memory (480 bytes with the int 33h handler
  25.           installed).
  26.       2.  To allow the user some control over the screen saver.
  27.  
  28.    VGAsave also has the ability to detect the use of a mouse and treat it
  29.    similar to keystroke on the keyboard.  This is a nice feature when using
  30.    programs, such as, the dosshell which use a mouse as the primary input
  31.    device.  However, due to the first requirement mentioned above VGAsave
  32.    does not suppress any mouse event used to restore a saved screen.
  33.    So, be forewarned that any action on the mouse used to restore a blanked
  34.    screen will be passed on to the program currently running as if nothing
  35.    happened.  Hence, if you press a button on the mouse to restore the
  36.    screen, the program currently running will also detect the button press.
  37.    I would strongly recommend sticking to some type of nondestructive action
  38.    like nudging the mouse slightly to restore a blanked screen.
  39.  
  40.    Note:  The keystrokes used to restore a blanked screen must be a
  41.           valid keystroke and will be suppressed by VGAsave.   By the
  42.           term "valid keystroke," it is meant that you have to hit a
  43.           letter, number, function key, etc. to restore the screen.
  44.           Hitting the alt, ctrl, or shift keys alone will NOT restore
  45.           the screen.  I usually use the space bar, but that's a matter
  46.           of preference.
  47.  
  48.  
  49.    Features
  50.    ========
  51.  
  52.             *   A hot key which may be used to blank the screen at anytime.
  53.  
  54.             *   Detects mouse movement to restore a blanked screen.
  55.  
  56.             *   User selected time out.
  57.  
  58.             *   User selected hot key.
  59.  
  60.             *   Help screen.
  61.  
  62.             *   Windows aware.  VGAsave will automatically disable itself
  63.                 when it detects that windows has been loaded and re-enable
  64.                 itself when windows has been exited.
  65.  
  66.             *   Off and On options to disable and enable VGAsave once
  67.                 VGAsave is resident in memory.
  68.  
  69.             *   An interactive menu to control various options after
  70.                 it has been loaded into memory.  Simply type "VGAsave"
  71.                 at the DOS prompt to start VGAsave.  Then type "VGAsave"
  72.                 again to bring up the menu.
  73.  
  74.             *   Command line switches for controlling VGAsave directly
  75.                 from the DOS prompt or from batch files.
  76.  
  77.             *   Minimal resident memory requirements -- 400 bytes to be
  78.                 exact (480 if the int 33h handler is installed).
  79.  
  80.             *   Supports DOS 5.0 upper memory blocks when loaded with
  81.                 DOS 5.0's loadhigh command.
  82.  
  83.             *   Its freeware.
  84.  
  85.  
  86.  
  87.    Freeware Notice
  88.    ===============
  89.  
  90.    VGAsave is released as FREEWARE and may not be sold under any
  91.    condition.  The copyright for VGAsave remains the sole property
  92.    of the author.   Modifications are prohibited.
  93.  
  94.    If you redistribute VGAsave, please distribute the entire package which
  95.    consists of VGAsave.com, Whatsnew, Readme, and VGAsave.doc.
  96.  
  97.  
  98.    Disclaimer
  99.    ==========
  100.  
  101.    This program is provided as is without any written or implied
  102.    warranty.
  103.  
  104.  
  105.    Starting VGAsave
  106.    ================
  107.  
  108.    VGAsave may be started with a default time out of 2 minutes by entering
  109.    VGAsave at the DOS prompt.  You may optionally specify a new time out by
  110.    using /c:[time out in seconds] as a command line argument.  For example,
  111.    entering "VGAsave /c:300" will start VGAsave with a time out value of
  112.    300 seconds or 5 minutes.  The /m- command line switch disable the
  113.    mouse intercept, the /key: switch to override the default hot key, and
  114.    the /win_off switch to disable the MS-Windows detection described below
  115.    may also be used when starting VGAsave.
  116.  
  117.    The IRQ line that VGAsave uses for its mouse intercept may be specified
  118.    with the /mirq command line switch.  An int 33h handler can be loaded
  119.    by using the /int33 switch.  The usage of the /mirq and /int33 is
  120.    discussed in the section entitled "Mouse Problems".  See the section
  121.    entitled "Command Line Switches" for full explanation of the command line
  122.    switches.
  123.  
  124.    Below are some examples on starting VGAsave.
  125.  
  126.    Examples:     C:>VGAsave          Start VGAsave with default values.
  127.    ========                          (Default values are shown below.)
  128.  
  129.                  C:>VGAsave /m-      Start VGAsave and disable the mouse
  130.                                      intercept.  You can turn the mouse
  131.                                      intercept back on once VGAsave is loaded
  132.                                      by using the /m+ switch described below.
  133.                                      Note that since you can turn the mouse
  134.                                      back on when you load VGAsave with the
  135.                                      /m- switch.  When used during loading,
  136.                                      this switch has the same overall effect
  137.                                      if you were to start VGAsave then run
  138.                                      it again with the /m- switch.  Hence,
  139.                                      VGAsave will report the same information
  140.                                      concerning the mouse whether or not this
  141.                                      switch is used during start up.
  142.  
  143.                  C:>VGAsave /c:300   Start VGAsave with a time out value of
  144.                                      5 minutes.  Again, you can later change
  145.                                      this.
  146.  
  147.                  C:>VGAsave /key:Alt-9    Start VGAsave and use alt-9 as a
  148.                                           hot key to blank the screen on
  149.                                           demand.  This may be also changed
  150.                                           after VGAsave is loaded.
  151.  
  152.                  C:>VGASave /mirq:3       Start VGAsave and force VGAsave
  153.                                           to use IRQ 3 for the mouse
  154.                                           intercept.  See "Mouse Problems"
  155.                                           below before using the switch.
  156.  
  157.                  C:>VGAsave /int33        Start VGAsave with the hook int 33h.
  158.                                           Read the section "Mouse Problems"
  159.                                           before using this switch.
  160.  
  161.                  C:>VGAsave /win_off      Disable the MS-Windows detection.
  162.  
  163.                  Any combination of the command line switches shown above
  164.                  may be used when starting VGAsave.  For example,
  165.  
  166.                  C:>VGAsave /c:300 /m- /Key:Alt-9
  167.  
  168.                  Sets the time out value to 5 minutes, disables the mouse
  169.                  intercept, sets the hot key to Alt-9.
  170.  
  171.                  See the section entitled "Controlling VGAsave after loading"
  172.                  for information on how to change VGAsave's settings after
  173.                  it has been started.
  174.  
  175.    Once the time out value has been reached VGAsave, will blank the screen
  176.    and return control back the program that is currently running.  Hence,
  177.    your program will continue to run as if nothing happened even if the
  178.    screen is blanked.  Once the screen is blanked, it may be restored by
  179.    pressing any key on the keyboard or by moving the mouse.
  180.  
  181.    Usage Note for Netware Users
  182.    ============================
  183.  
  184.    This information was passed on to me from Andy Charmatz.
  185.  
  186.    Netware users should load VGAsave in memory before the network shell
  187.    (NETx.com) so that if a network broadcast message appears, pressing a
  188.    key will properly restore the screen.
  189.  
  190.    Default Settings for VGAsave
  191.    =============================
  192.  
  193.        Saver:            Enabled
  194.        Mouse Intercept:  (Enabled if you have a mouse)
  195.        Time Out:         120 seconds
  196.        Hot Key:          Alt-0
  197.  
  198.  
  199.  
  200.    Controlling VGAsave after loading
  201.    =================================
  202.  
  203.    Once VGAsave has been loaded in memory, commands may be passed to it in
  204.    two ways.
  205.  
  206.        1.  Issuing "VGAsave" at the DOS prompt will bring up a menu of
  207.            choices.
  208.        2.  Issuing VGAsave save at the DOS command prompt with one
  209.            or more command line arguments.
  210.  
  211.  
  212.    Interactive Menu
  213.    ================
  214.  
  215.    Running VGAsave.com without any command line arguments once the screen
  216.    saver has been loaded into memory will bring up the following menu of
  217.    choices.  Note that this means you have to run VGAsave more than once
  218.    to get the menu.  The first time you run the program, VGAsave loads
  219.    the screen saver code into memory.  The second time you run VGAsave, the
  220.    menu will be displayed if no command line switches were used.
  221.  
  222.  
  223.                 VGAsave already installed.
  224.  
  225.                 Press <R>  to remove from memory
  226.                       <->  to disable VGAsave
  227.                       <+>  to enable VGAsave
  228.                       <N>  to blank the screen now
  229.                       <C>  for a new time out
  230.                       <M>  to enable mouse intercept
  231.                       <D>  to disable mouse intercept
  232.                       <K>  for new hot key
  233.                       <S>  for VGAsave settings
  234.                       <A>  to disable MS-Windows detection
  235.                       <B>  to enable MS-Windows detection
  236.                       <?>  for help
  237.  
  238.                 or any other key to continue:
  239.  
  240.  
  241.         *  All the functions listed in the menu above have a command
  242.            line equivalent which are outlined below along with an
  243.            explanation of what each function does.  A listing of the
  244.            command line parameters may be obtained by using "?" from
  245.            the above menu.  There is also a command line option, /i?,
  246.            which may be used in batch files to obtain the current status
  247.            of VGAsave, and an /unblank switch which can be used to force
  248.            the screen to unblank from within batch files.  See the
  249.            discussion on "Command Line Switches" below for further
  250.            information on the /i? and /unblank switches.
  251.  
  252.         *  Note that the keys used to select a menu option are not case
  253.            sensitive.  In other words, either "S" or "s" will select the
  254.            VGAsave settings option form the menu.
  255.  
  256.         *  Selecting option "C" for a new time out value will display the
  257.            current time out and bring up the following prompt:
  258.  
  259.               Enter the new time out in seconds or hit <enter> to quit:
  260.  
  261.            If you change you mind at this point and decide that you don't
  262.            to change the time out, just hit the enter key with an empty
  263.            input field.  Otherwise, just type in the desired time out in
  264.            seconds and hit enter.
  265.  
  266.            Destructive backspacing is supported and the escape key will
  267.            clear the entire input field.  Note the time out value must be a
  268.            whole number between 10 and 3600.  If you try and enter more
  269.            than 4 digits, VGAsave will beep at you since that is automatically
  270.            invalid.  If you enter a value too large or too small VGAsave
  271.            will report an error along with the proper command line syntax
  272.            for changing the time out value and kick you out of the program
  273.            without changing the time out value.
  274.  
  275.         *  Selecting option "K" from the menu will bring up the following
  276.            screen of possible hot key choices:
  277.  
  278.            Alt-A    Alt-B    Alt-C    Alt-D    Alt-E    Alt-F    Alt-G
  279.            Alt-H    Alt-I    Alt-J    Alt-K    Alt-L    Alt-M    Alt-N
  280.            Alt-O    Alt-P    Alt-Q    Alt-R    Alt-S    Alt-T    Alt-U
  281.            Alt-V    Alt-W    Alt-X    Alt-Y    Alt-Z
  282.  
  283.            Alt-0    Alt-1    Alt-2    Alt-3    Alt-4    Alt-5    Alt-6
  284.            Alt-7    Alt-8    Alt-9    None
  285.  
  286.            The hot key currently being used by VGAsave will be highlighted.
  287.            Simply use the cursor controls to move the highlight bar
  288.            to the desired key and hit the enter key or the space bar
  289.            to select that key.
  290.  
  291.            The highlight bar will "wrap" around the menu if you hit a
  292.            cursor key that points to a location off the menu.  Please note
  293.            that since the keys are divided into 2 groups on the screen,
  294.            numbers and letters, the highlight bar wraps as follows:
  295.  
  296.            Horizontal Wrapping           Vertical Wrapping
  297.             Alt-A <==> Alt-Z              Alt-A <==> Alt-7
  298.             Alt-G <==> Alt-H              Alt-B <==> Alt-8
  299.             Alt-N <==> Alt-O              Alt-C <==> Alt-9
  300.             Alt-U <==> Alt-V              Alt-D <==> None
  301.             Alt-0 <==> None               Alt-E <==> Alt-4
  302.             Alt-6 <==> Alt-7              Alt-F <==> Alt-5
  303.                                           Alt-G <==> Alt-6
  304.  
  305.            In other words, the vertical cursor controls fully wrap around
  306.            the menu.  But, the horizontal ones wrap in a manner so that
  307.            the highlight bar will always remain in the upper or lower portion
  308.            of the menu.
  309.  
  310.        Command Line Switches
  311.        =====================
  312.  
  313.          /?     Displays a help message -- Note that VGAsave need not
  314.                 be loaded in memory to display the help message.  In
  315.                 other words, issuing "VGAsave /?" at the DOS prompt
  316.                 when VGAsave is not currently loaded in memory will
  317.                 cause it to display a help message outlining the
  318.                 command line parameters without loading VGAsave into
  319.                 memory.
  320.  
  321.          /c:n   Changes the time out value to n seconds and
  322.                 10 ≤ n ≤ 3600 -- This command line argument may
  323.                 be specified when VGAsave is initially being loaded
  324.                 into memory.
  325.  
  326.          /off   Disables VGAsave -- useful for programs that don't
  327.                 require much user interaction, such as, gif viewers or
  328.                 programs, such as, Microsoft Windows which are not
  329.                 compatible with VGAsave.
  330.  
  331.          /on    Enables VGAsave -- when it has been disabled with /off
  332.                 Note:   /on and /off can be used to trick VGAsave into
  333.                 resetting its internal clock to 0 as follows:
  334.  
  335.                             VGAsave /off  ; disables VGAsave and
  336.                                           ; resets the current time
  337.                                           ; count to 0
  338.  
  339.                             VGAsave /on   ; enables VGAsave
  340.  
  341.                 This is sometimes useful in batch files.
  342.  
  343.          /r     Removes VGAsave from memory.
  344.                 See section below on "Removing VGAsave from Memory".
  345.  
  346.          /now   Forces the screen to immediately blank -- may be useful
  347.                 for batch files.  The same action can be accomplished
  348.                 directly from the keyboard by using the user-selected
  349.                 hot key (Alt-0 by default).  Note that this command
  350.                 forces VGAsave to be enabled otherwise there would be
  351.                 no means to restore the screen if VGAsave was disabled.
  352.  
  353.          /unblank  Forces the screen to immediately if it is blank.  If
  354.                    the screen is not blanked, the only effect this command
  355.                    will have is to set VGAsave's internal time count to
  356.                    zero.  This switch is intended for use in batch files.
  357.                    It makes no sense to type it in from the command line
  358.                    since the first key you hit to type in the command will
  359.                    cause the screen to wake up.
  360.  
  361.                    Take the follow example for a batch file:
  362.  
  363.                             @echo off
  364.  
  365.                             rem this is optional
  366.                             vgasave /now
  367.  
  368.                             rem Now run some program(s) that
  369.                             rem take(s) a long time to complete
  370.                             slowpgm.exe
  371.  
  372.                             vgasave /unblank
  373.  
  374.                    If you are running DOS 5 or 4DOS, a similar thing
  375.                    can be accomplished from the command line using the
  376.                    command line separator (ctrl-T in DOS 5).
  377.                    Example:
  378.  
  379.                    C:>slowpgm.exe<ctrl-T>VGAsave /unblank
  380.  
  381.                    Note:  In the above line, <ctrl-T> means hold
  382.                           down the control key and hit the T key.
  383.                           This will produce a pilcrow character on the
  384.                           screen.
  385.  
  386.          /m-    Disables mouse intercept -- can be used to disable the
  387.                 screen restoring on mouse action feature.  This command
  388.                 line switch may be used when starting VGAsave.  (Only
  389.                 useful if you have a mouse.)
  390.  
  391.                 If you do use this command on start up, it has the overall
  392.                 effect of starting VGAsave and then issuing VGAsave /m- after
  393.                 VGAsave has been started.  Hence, the same behavior can be
  394.                 expected from VGAsave if you were to do the following:
  395.  
  396.                     C:>VGAsave       (load VGAsave into memory)
  397.                     C:>VGAsave /m-   (turn off mouse intercept)
  398.  
  399.  
  400.                 So, if VGAsave is giving an error related to the mouse
  401.                 when its initially loaded into memory, using the /m- switch
  402.                 on start up will not cause VGAsave to quit reporting the
  403.                 message.  VGAsave will load as usual then if the /m- switch
  404.                 is found, VGAsave will disable the mouse intercept.  The
  405.                 reason it works like this is that if you did load VGAsave
  406.                 with /m- for some reason you could later enable the mouse
  407.                 with /m+ without removing VGAsave from memory and
  408.                 re-installing it.  I'm not sure if I like it this way or
  409.                 not.
  410.  
  411.          /m+    Enables mouse intercept  -- used to restore the screen
  412.                 restoring feature on a mouse action when it has been
  413.                 disabled with /m-.  (Only useful if you have a mouse.)
  414.  
  415.          /int33 Instructs VGAsave to install an int 33h handler during
  416.                 start up.  The interrupt 33h handler is required by VGAsave
  417.                 if VGAsave fails to unblank the screen with a mouse action
  418.                 after a program has been run or is running that has mouse
  419.                 support.  (Only useful if you have a mouse.)
  420.  
  421.                 THE /int33 COMMAND LINE SWITCH MAY ONLY BE USED DURING START
  422.                 UP.
  423.  
  424.                 Read the section "Mouse Problems" before using this switch.
  425.  
  426.                 Also note that the status command (VGAsave /s) will report
  427.                 wether or not the /int33 switch has been used when VGAsave
  428.                 was started.
  429.  
  430.          /mirq: Allows the user to manually specify the IRQ line to be
  431.                 hooked by VGAsave for the mouse intercept.  (Only useful
  432.                 if you have a mouse.)
  433.  
  434.                 THE /mirq COMMAND LINE SWITCH MAY ONLY BE USED DURING START UP.
  435.  
  436.                 THE /mirq COMMAND SHOULD ONLY BE USED IF YOU ARE EXPERIENCING
  437.                 DIFFICULTIES WITH YOUR MOUSE RESTORING A BLANKED SCREEN.
  438.  
  439.                     Syntax:  /mirq:[num]
  440.  
  441.                 Where [num] is the IRQ line that you want VGAsave to
  442.                 hook.  Valid IRQ lines are from 2 to 15.  Read the section
  443.                 below entitled "Mouse Problems" before using this switch.
  444.  
  445.                     Example:  VGAsave /mirq:3
  446.  
  447.                 Tells VGAsave to hook up IRQ 3 which is typically
  448.                 used by COM2.  Hence, you are telling VGAsave that
  449.                 you have a serial mouse that is using IRQ 3.
  450.  
  451.          /win_off  This command line switch disables the MS-Windows
  452.                    detection.  When the MS-Windows detection is disabled,
  453.                    VGAsave will not disable itself when MS-Windows is loaded.
  454.  
  455.          /win_on   This will enable the MS-Windows detection.  Note that
  456.                    this is the default state for VGAsave.  When the windows
  457.                    detection is enabled, VGAsave will automatically disable
  458.                    itself when windows is loaded and not allow the user to
  459.                    re-enable the screen saver until windows has been exited.
  460.                    See the section below concerning MS-Windows for more
  461.                    information.
  462.  
  463.          /key:  This command line switch changes the hot key used to
  464.                 blank the screen on demand.
  465.  
  466.                   Syntax:  /KEY:[key]
  467.                   where [key] is one of the following:
  468.  
  469.                       Alt-0 to Alt-9, Alt-A to Alt-Z
  470.                       None   (disables the hot key)
  471.                       Note that Alt-0 is the default
  472.  
  473.                  For example, to set the hot key to Alt-5, issue
  474.                  "VGAsave /Key:Alt-5" at the DOS prompt.  If the
  475.                  none option is selected (i.e. "VGAsave /Key:none"),
  476.                  then the hot key support to blank the screen will
  477.                  be disabled -- the hot key may be later enabled
  478.                  again by selecting a hot key other than None.
  479.  
  480.                  The /key: command line switch may also be used
  481.                  when VGAsave is initially loaded into memory.
  482.  
  483.                  You can also change the hot key interactively
  484.                  after starting VGAsave by issuing "VGAsave" at
  485.                  the DOS prompt and selecting option "K" from the
  486.                  menu.  This will bring up a menu of possible choices
  487.                  and some instructions.
  488.  
  489.          /S    Displays the current settings of VGAsave.  For example,
  490.                issuing "VGAsave /s" at the DOS prompt after starting
  491.                VGAsave without any command line options displays the
  492.                following information:
  493.  
  494.                     Copyright (c) 1992, 1993  Bill Javurek
  495.                     Freeware.  No Modifications. May not be sold.
  496.  
  497.                     Alt-0 may be used to blank the screen at any time.
  498.  
  499.                     Saver:                 Enabled
  500.                     MS-Windows Detection:  Enabled
  501.                     Mouse Intercept        (Enabled if you have a mouse)
  502.                     Int 33h Hook:          Not loaded
  503.                     Time Out:              120 seconds
  504.                     Hot Key:               Alt-0
  505.  
  506.                 which reflects VGAsave's default settings.
  507.  
  508.          /i?   Returns the status of VGAsave by means of an exit code.
  509.                This option provides a means for batch files to
  510.                obtain the current status of VGAsave and branch with
  511.                an ErrorLevel statement.  This option has no
  512.                interactive (i.e. menu option) equivalent like the other
  513.                command line options do.
  514.  
  515.                The possible exit codes are as follows:
  516.  
  517.                    Exit Code = 1  ==>  VGAsave is not installed
  518.                    Exit Code = 2  ==>  VGAsave is currently disabled
  519.                    Exit Code = 0  ==>  Neither of the above are true  :)
  520.  
  521.                These Exit codes may be used by a batch file in the
  522.                following manner:
  523.  
  524.                    VGAsave /i?
  525.                    If ErrorLevel == 2 Goto VGAsaveDisabled
  526.                    If ErrorLevel == 1 Goto VGAsaveNotInstalled
  527.  
  528.                Note that the ErrorLevel must be tested in "reverse
  529.                order" since DOS checks for greater than or equal to
  530.                when using an If statement in a batch file.
  531.  
  532.                IMPORTANT:  VGAsave will only return a non-zero
  533.                exit code when this command line switch is used.
  534.                In all other cases, the exit code for VGAsave will
  535.                be zero.
  536.  
  537.  
  538.      Notes On Command Line Usage
  539.      ===========================
  540.  
  541.      The "/i?" switch has highest priority.  Using this command will cause
  542.      VGAsave to return its current status and exit the program.  ALL OTHER
  543.      COMMANDS WILL BE IGNORED.
  544.  
  545.      The help command "/?" has second highest priority. Using this command
  546.      will cause VGAsave to display a help message and exit the program.  ALL
  547.      OTHER COMMANDS WILL BE IGNORED.
  548.  
  549.      The remaining commands may be used individually or in groups of
  550.      compatible commands.  The following table shows the INCOMPATIBLE command
  551.      groups.
  552.  
  553.              /r with any thing else  ==>  Can't remove the screen saver and
  554.                                           send commands to the resident code
  555.                                           at the same time.
  556.  
  557.              /off /on         ==>  Can't turn the screen saver on and off
  558.                                    at the same time.
  559.  
  560.              /m+ /m-          ==>  Can't have the mouse intercept enabled
  561.                                    and disabled at the same time.
  562.  
  563.              /off /now        ==>  The screen saver must be enabled to use
  564.                                    the /now switch.  (If the saver is
  565.                                    currently disabled, and the /now switch
  566.                                    is used without the /off switch, VGAsave
  567.                                    will enable itself and blank the screen).
  568.  
  569.             /win_off /win_on  ==>  Can't enable and disable the windows
  570.                                    detection at the same time.
  571.  
  572.      If VGAsave detects an invalid command group, it will ignore the
  573.      conflicting commands and report an error.  If any other valid commands
  574.      were included in the command line, they will be processed.  For example,
  575.      issuing "VGAsave /off /m+ /m-"  will disable VGAsave (/off switch) and
  576.      report an error message for the two conflicting commands (/m+ and /m-).
  577.      VGAsave is also capable of detecting multiple command line conflicts.
  578.      Try "VGAsave /m- /m+ /off /on /now /r".
  579.  
  580.      The command must be proceeded by either a forward slash, /, a back
  581.      slash, \, or a dash, -.  In other words, issuing "VGAsave /r",
  582.      "VGAsave \r", or "VGAsave -r" all have the same effect.  The forward
  583.      slash has been used above for purposes of illustration.  However, the
  584.      back slash or the dash may also be used.
  585.  
  586.      Also note that the command line is not case sensitive, i.e. the
  587.      command /r is identical to /R.
  588.  
  589.      One final point on command line usage, the /mirq and /int33 command
  590.      line switches may only be used when VGAsave is initially loaded into
  591.      memory.
  592.  
  593.  
  594.     Batch File Usage Notes
  595.     ======================
  596.  
  597.     If you call VGAsave in a batch file to disable it or whatever, you
  598.     can hide VGAsave's messages by redirecting its output to the DOS
  599.     NUL device.
  600.  
  601.     Example:   VGAsave /off >nul
  602.  
  603.     You can try the above example at the DOS command prompt for a test.
  604.     Then try VGAsave /on to enable VGAsave and see a message similar to
  605.     the one suppressed by the DOS I/O redirection.
  606.  
  607.  
  608.     Compatibility Issues
  609.     ====================
  610.  
  611.     Some software will not function properly with VGAsave due to the
  612.     manner in which the keyboard and mouse interrupts are used.  For
  613.     example, Microsoft Windows is completely incompatible with VGAsave.
  614.     On the other hand, some software is only partially compatible with
  615.     VGAsave.  In particular, some games capture the keyboard interrupt
  616.     to increase speed, and VGAsave will not be able to detect any
  617.     keystrokes.  Hence, when the screen blanks, it cannot be restored by
  618.     pressing a key -- any key pressed will be processed directly by the
  619.     game.  However, when using VGAsave in conjunction with some games
  620.     the screen may be restored by moving the mouse which can best be
  621.     described as a partial incompatibility.  The only way to find out if
  622.     a problem such as this exists is to try VGAsave.  If a problem does
  623.     exist, use VGAsave /off before starting the incompatible application.
  624.     Then VGAsave /on can be used after running the application.  If this
  625.     is a satisfactory solution a batch file can then be written to launch
  626.     the application which turns VGAsave off before running the program and
  627.     then turns VGAsave back on afterward.
  628.  
  629.     Some users have reported problems with the mouse support.  The
  630.     basic scenario is that everything is fine until an application is
  631.     launched that uses the mouse.  VGAsave then no longer recognizes
  632.     the presence of the mouse.  This topic is discussed in the section
  633.     entitled "Mouse Problems below.
  634.  
  635.     A potential compatibility problem also may exist with some keyboard
  636.     enhancement programs since VGAsave directly manipulates the BIOS keyboard
  637.     buffer.  This issue is discussed under the section entitled
  638.     Technical Info.
  639.  
  640.  
  641.     Note for Microsoft Windows
  642.     ==========================
  643.  
  644.      Since Windows is a multitasking environment, it handles the use
  645.      of software interrupts differently than DOS does, and in enhanced
  646.      mode windows uses a completely different memory addressing scheme.
  647.      Hence, most TSR's will not function properly under Windows.  In
  648.      the case of VGAsave, the screen will blank according to the specified
  649.      time out value.  However, Windows will not allow VGAsave to properly
  650.      detect any mouse motion or keyboard action to restore the screen.  So,
  651.      your stuck with a blank screen that can't restored without somehow
  652.      exiting Windows (which is tough when you can't see what you are doing)
  653.      or rebooting the system.
  654.  
  655.      However, starting with Version 2.00, VGAsave is windows aware.  VGAsave
  656.      will detect that windows has been loaded and automatically disable itself.
  657.      Upon exiting windows, VGAsave will re-enable itself.  The chain of
  658.      events when windows is loaded goes something like this:  VGAsave is
  659.      disabled, the screen is unblanked, and the internal time count set to 0.
  660.  
  661.      It should be noted that when windows has been loaded, VGAsave enters what
  662.      may be described as a locked state.  VGAsave is locked in the sense that
  663.      it cannot be enabled under any condition if windows is active.  This may
  664.      be checked with the status command (VGAsave /s).
  665.  
  666.      When windows is active, the status command will show that the saver has
  667.      been disabled for MS-Windows.  That means that VGAsave is off period.  If
  668.      you try to re-enable VGAsave with the /on switch, VGAsave will issue a
  669.      warning informing you that the saver will be enabled once windows has
  670.      been exited.  There are some subtleties associated with this point.  For
  671.      example, if VGAsave has been disabled with /off for some reason before
  672.      starting windows, VGAsave will remain disabled upon exiting windows.
  673.      However, if you issue VGAsave /on while windows is active, VGAsave will be
  674.      re-activated when windows has been exited.  The reason for this is simple.
  675.      VGAsave uses two flags to determine if the saver is enabled.   One flag is
  676.      controlled exclusively by MS-Windows and the other by the usual /on and
  677.      /off commands.  Both flags must be clear for the saver to blank the
  678.      screen.  Now if windows is active, one flag will be set.  Issuing
  679.      VGAsave /on will clear the other flag.   The warning message that
  680.      VGAsave issues when /on is used while windows is active serves only
  681.      to inform the user that the command will not take effect until windows
  682.      has been exited.
  683.  
  684.      The status command will also display the status of the MS-Windows
  685.      detection (i.e. Enabled/Disabled).  I left the user the option to
  686.      disable the windows detection just in case some unforeseen
  687.      incompatibility arises.  In the case that the windows detection fails
  688.      to function properly, you must launch windows from a batch file or a
  689.      DOSkey alias that will disable VGAsave before starting windows.  A
  690.      skeleton batch file goes something like this:
  691.  
  692.  
  693.                      VGAsave /off > nul
  694.                      Win.com
  695.                      VGAsave /on  > nul
  696.  
  697.      The "> nul" is used to hide VGAsave's messages and may be omitted.
  698.  
  699.      You can make the batch file a little more spiffy by using the /i?
  700.      option as follows:
  701.  
  702.                      VGAsave /i?
  703.                      If ErrorLevel == 2 Goto RunWindows
  704.                      rem  VGAsave is already off
  705.  
  706.                      If ErrorLevel == 1 Goto RunWindows
  707.                      rem  VGAsave not installed
  708.  
  709.                      rem  Get to this point if VGAsave is installed and
  710.                      rem  active
  711.  
  712.                      VGAsave /off  > nul
  713.                      win.com
  714.                      VGAsave /on   > nul
  715.                      Goto End
  716.  
  717.                      :RunWindows
  718.                      win.com
  719.  
  720.                      :End
  721.                      rem  End of batch file
  722.  
  723.  
  724.      This problem is not unique to VGAsave and has occurred with other
  725.      screen savers that I have tried in the past.  This is one of the
  726.      reasons that prompted me to write VGAsave.  In the worst case when
  727.      using VGAsave, you can temporarily disable it with /off while using
  728.      Windows.  Whereas with most other screen savers, you are forced to
  729.      reboot the system before running Windows to get the screen saver out
  730.      of memory since a means to disable the screen blanking function is
  731.      not usually provided.
  732.  
  733.  
  734.     What if VGAsave doesn't work?
  735.     =============================
  736.  
  737.     If VGAsave is having difficulty recognizing the mouse on your
  738.     system, read the section on Mouse Problems and follow the
  739.     recommendations outlined in that section.  Then if VGAsave is still
  740.     giving you trouble, the discussion here may be of some help.
  741.  
  742.     VGAsave was written in what I consider a robust manner.  But, some
  743.     problems still could arise.
  744.  
  745.     First, if you are experiencing problems and you are loading VGAsave
  746.     high, try loading it into base memory.  I've had some bad experiences
  747.     loading TSR's high which I don't really want to recall.  So, this could
  748.     be a problem.  If VGAsave works fine in base memory but malfunctions
  749.     when loaded high, the only thing that can be done is to rearrange
  750.     the order in which you load all your TSR's in the autoexec.bat.  My
  751.     understanding here is that you can run into problems loading TSR's
  752.     high since the UMB's are non-contiguous and fixed in size.
  753.  
  754.     If you are loading VGAsave in base memory and still having trouble, the
  755.     next logical step is to boot the system off of a floppy loading just
  756.     command.com, the mouse driver (if you have a mouse) and VGAsave.  If the
  757.     problem goes away then VGAsave is conflicting with another TSR that
  758.     you are using.  I can't stress this point enough.  If you are having
  759.     problems, remove all unnecessary TSR's and device drivers before you
  760.     conclude that you have found a bug in VGAsave.  Now if VGAsave works
  761.     when it is the only thing loaded besides command.com and the mouse
  762.     driver, try restoring your config.sys and rebooting.  If all everything
  763.     is still fine at this point, start adding your TSR's back into your
  764.     autoexec.bat one by one rebooting after adding each one.  Eventually,
  765.     you should come to a point where VGAsave malfunctions.  Then you know
  766.     which TSR VGAsave is conflicting with.  Once you have reached that
  767.     point try loading VGAsave before and after the conflicting TSR, and you
  768.     should find that either loading VGAsave before or after makes both
  769.     VGAsave and the other TSR happy.  If not, then you have to make a choice
  770.     about which TSR you'd rather have.
  771.  
  772.     The problem here is not necessarily VGAsave or the other TSR.  It boils
  773.     down to the many different approaches used to write TSRs some are better
  774.     than others.  When I wrote VGAsave, as I mentioned, I did quite a bit of
  775.     research on the topic and tried to pick the most reliable configuration.
  776.     Unfortunately, TSR development is something not very well documented.
  777.     Hence, over the years, programmers have developed many different
  778.     approaches.  Thus, you may have to juggle the order in which you load
  779.     everything to make all your TSR's happy.
  780.  
  781.     Another possible situation that could arises is that all is well until
  782.     you add VGAsave to your autoexec.bat then some other TSR refuses to load.
  783.     In this case what is happening is that VGAsave is using the other TSR's
  784.     int 2fh or multiplex signature.  This is possible since when you first
  785.     load VGAsave into memory it will search for the first unused int 2fh
  786.     signature as explained in the section on Interrupt Usage below and use
  787.     it.  If this happens to be the signature of another TSR, that one may
  788.     refuse to load or corrupt VGAsave if the "other" TSR uses int 2fh,
  789.     service 00 in a nonstandard way.  In that case, the solution is
  790.     to load VGAsave at a different point in your autoexec.bat.  If you are
  791.     loading VGAsave first in your autoexec.bat, try loading it last and
  792.     vice versa.  TSR's are strange animals.  So, you may have to play around
  793.     a little bit to make all your TSR's function correctly.
  794.  
  795.     Another possibility is that VGAsave is not compatible with some application
  796.     that you have.  In that case, the best that can be done is to launch that
  797.     particular application from a batch file similar to the one described
  798.     above for windows.  In particular, games could pose a problem since
  799.     they may directly process the mouse and keyboard interrupts and directly
  800.     access the graphics card.
  801.  
  802.  
  803.     Mouse Problems
  804.     ==============
  805.  
  806.     Several users have reported problems with VGAsave 1.91 recognizing the
  807.     mouse on their systems.  These problems fall into 2 categories.
  808.  
  809.          1.  The interrupt chain is corrupted by the mouse driver forcing
  810.              the mouse IRQ to point directly to the mouse driver with out
  811.              preserving the interrupt chain.  (The mouse IRQ hook is explained
  812.              below in the section "Mouse Hardware Interrupt", and the interrupt
  813.              chain concept is outlined in "Removing VGAsave from Memory".)
  814.  
  815.          2.  The mouse driver is not reporting or is incorrectly reporting
  816.              the IRQ line that the mouse is using.
  817.  
  818.     Try and bare with me while I attempt to explain all of this.  This mouse
  819.     issue is somewhat complicated.  After outlining the problems in detail,
  820.     the actions will be discussed.  Here we go.
  821.  
  822.     Problem #1:  Interrupt chain corruption.
  823.     ----------------------------------------
  824.  
  825.     Interrupt chain corruption was first observed when running the dosshell
  826.     with VGAsave.  The symptoms are that VGAsave works fine until the dosshell
  827.     is launched then VGAsave fails to recognize the mouse even after the shell
  828.     has been exited.  The root cause of the problem has been traced to the
  829.     mouse driver.  In essence, what happens is that the dosshell makes a call
  830.     to the mouse driver via int 33h, and the mouse driver for whatever reason
  831.     forces the mouse IRQ to point directly to the mouse driver while it is
  832.     processing the int 33h call.  The mouse driver's interrupt handler for
  833.     the mouse IRQ terminates in an iret.  Hence, the interrupt chain is not
  834.     preserved, and all mouse actions become "invisible" to VGAsave.
  835.  
  836.     Thus, if VGAsave is unblanking the screen with mouse actions as it is
  837.     supposed to then quits recognizing the mouse after some application is
  838.     started.  Most likely the interrupt chain has become corrupted in the
  839.     manner described above.  Note again that the cause is the *mouse driver*.
  840.     So, the problem is application independent and depends only on the mouse
  841.     driver.
  842.  
  843.     The solution to this problem implemented was to add an int 33h hook
  844.     to VGAsave.   By default the int 33 handler is not installed to conserve
  845.     memory.  To use the int 33 handler start VGAsave with the /int33 switch.
  846.     When VGAsave is started in this manner, every call made to int 33h will
  847.     cause VGAsave to check the mouse IRQ.  Since the mouse driver corrupts
  848.     the interrupt chain as part of the int 33h service, VGAsave first calls
  849.     the mouse driver int 33h handler as a subroutine to process the interrupt
  850.     call.  Then VGAsave will check to see if the mouse IRQ is still pointing
  851.     to VGAsave.  If the IRQ is not pointing to VGAsave, VGAsave checks to see
  852.     if it is pointing at the mouse driver.  If the IRQ vector is pointing to
  853.     the mouse driver, VGAsave forces it to point back to VGAsave which is the
  854.     state that the mouse IRQ interrupt chain was in before the mouse driver
  855.     redirected the vector (the int table points to VGAsave, VGAsave points to
  856.     the mouse driver).  Strictly speaking, checking to see if the mouse IRQ is
  857.     pointing to the mouse driver if it is not pointing to VGAsave is not
  858.     necessary, but it is a good insurance policy.
  859.  
  860.     The reason for the "insurance policy"  is that an assumption has been
  861.     made that VGAsave and the mouse driver are the only programs hooked to
  862.     the mouse IRQ vector. This assumption is reasonable since if some
  863.     other peripheral was to use the same IRQ vector as the mouse a conflict
  864.     probably would arise.  But, its difficult  if not impossible to depend
  865.     on that.  Hence, if for some reason another TSR/device driver takes
  866.     control of the mouse IRQ VGAsave will not change the IRQ vector as a
  867.     means of insuring system integrity.  The reason for this is that the
  868.     fundamental assumption that the int 33h hook was designed around has been
  869.     violated, and the state of the system is unknown at this point.  This case
  870.     *should* never occur.  But, if it did and a check (i.e. insurance policy)
  871.     was not implemented, VGAsave would update the interrupt table, and a system
  872.     crash becomes possible.  However, even if some weird case would occur that
  873.     would violate the fundamental assumption, the mouse will only be
  874.     temporarily be invisible to VGAsave since sooner or later the mouse driver
  875.     will force the IRQ vector to point back to the mouse driver.  Then on the
  876.     next int 33h call, VGAsave will point the mouse IRQ back to VGAsave.
  877.  
  878.     The other assumption buried in this is that VGAsave is loaded in memory
  879.     after the mouse.  This is true by default since during start up VGAsave
  880.     will not detect the presence of the mouse if VGAsave is loaded in memory
  881.     before the mouse driver.
  882.  
  883.     It should be clear at this point that installing the int 33h hook will
  884.     not influence VGAsave if the int 33h hook is not required.  The
  885.     reason that I have made this optional is that the int 33h hook will
  886.     increase the resident memory requirement of VGAsave from 400 to 480 bytes.
  887.     Granted, its a trivial increase, but why spend memory if its not required.
  888.  
  889.  
  890.     Problem 2:  Mouse Driver fails to report the IRQ line.
  891.     ------------------------------------------------------
  892.  
  893.     First, lets discuss how VGAsave uses the mouse driver during start up.
  894.  
  895.     When VGAsave is run for the first time, an int 33h, function 00h is
  896.     called to detect the presence of the mouse.  If a mouse is
  897.     detected, VGAsave then calls int 33h, function 36d to get the IRQ line
  898.     used by the mouse.  Several things can go wrong when function 36 is
  899.     called.
  900.  
  901.     The most common problem is that the mouse driver is old and
  902.     function 36 is not supported.  If VGAsave detects that this function
  903.     is not supported the following error will be reported:
  904.  
  905.        "Mouse function 36 not supported by the current mouse driver."
  906.  
  907.     It is possible that VGAsave does not detect that this function is
  908.     unsupported by the current mouse driver or that the mouse driver
  909.     is reporting nonstandard data.  If this is the case, VGAsave will
  910.     load up and act like everything is fine, but you won't be able to
  911.     unblank the screen with the mouse.
  912.  
  913.     Basically, there are two things you can do at this point, if either
  914.     one of these conditions are true:  get a new mouse driver or use the
  915.     /mirq command line switch.
  916.  
  917.  
  918.     The /mirq switch
  919.     ----------------
  920.  
  921.     As noted above, this switch allows the user to manually supply
  922.     the IRQ line that VGAsave will hook for the mouse interrupt.
  923.     This switch may only be used when VGAsave is initially loaded
  924.     into memory and will force VGAsave to skip the int 33h, function
  925.     36d call.  You are completely on your own here and you
  926.     have to find out what IRQ your mouse is using before this switch
  927.     may be used.
  928.  
  929.     If you are lucky, your mouse driver reports the IRQ usage when
  930.     the driver is loaded into memory.  So, all that you may have to
  931.     do is strip down your autoexec.bat and config.sys files so that
  932.     any messages the mouse driver prints when loading won't scroll
  933.     off the screen.  Another possibility is to check the documentation
  934.     that came with the mouse.
  935.  
  936.     If neither of these approaches work, you need to get a "bigger hammer".
  937.     The big hammer in this case would be some kind of memory mapping software
  938.     that will show you the interrupt usage.  Norton Utilities 6.01 has
  939.     a sysinfo program that will report IRQ usage, one user noted that
  940.     QEMM's manifest will report interrupt usage, the turbo assembler
  941.     comes with tdmem that reports software interrupt usage.  I assume that
  942.     PC Tools has something that will work too.  If you don't have access
  943.     to any of the mentioned tools or something similar, there are several
  944.     memory mapping programs at simtel that could probably be used for this
  945.     purpose.  If you need to download a memory mapper from simtel, try
  946.     in the msdos/sysutl and msdos/info directories.  Another possibility
  947.     is to check into some PC Magazine utilities.
  948.  
  949.     As explained in the "Mouse Hardware Interrupt" section below,
  950.     when an IRQ occurs the current program is suspended and the CPU
  951.     executes an int instruction to service the IRQ request.  The int
  952.     that the CPU issues does *NOT* have the same number as the IRQ since
  953.     IRQ refers to Interrupt Request and it is a hardware concept.  The
  954.     correspondence is as follows:  (Note h ==> hex and d ==> decimal number.)
  955.  
  956.          IRQ   ==>    software int             *Typical* Usage
  957.          ---          ------------             ---------------
  958.  
  959.         IRQ 00 ==> int 08h (int 08d)            Timer
  960.         IRQ 01 ==> int 09h (int 09d)            Keyboard
  961.         IRQ 02 ==> int 0ah (int 10d)            Slave PIC
  962.         IRQ 03 ==> int 0bh (int 11d)            COM 2
  963.         IRQ 04 ==> int 0ch (int 12d)            COM 1
  964.         IRQ 05 ==> int 0dh (int 13d)            LPT 2
  965.         IRQ 06 ==> int 0eh (int 14d)            Floppy disks
  966.         IRQ 07 ==> int 0fh (int 15d)            LPT 1
  967.  
  968.         IRQ 08 ==> int 70h (int 112d)           Real time clock
  969.         IRQ 09 ==> int 71h (int 113d)           IRQ 2 redirect
  970.         IRQ 10 ==> int 72h (int 114d)           ?
  971.         IRQ 11 ==> int 73h (int 115d)           ?
  972.         IRQ 12 ==> int 74h (int 116d)           Mouse on PS/2 50+
  973.         IRQ 13 ==> int 75h (int 117d)           Math Coprocessor
  974.         IRQ 14 ==> int 76h (int 118d)           Hard disk
  975.         IRQ 15 ==> int 77h (int 119d)           ?
  976.  
  977.  
  978.     Unless the software specifically indicates that it is reporting
  979.     hardware interrupts or IRQ lines, it is probably telling you the
  980.     software interrupt.  Most likely, the memory mapping software
  981.     will report the software interrupt in hexadecimal notation.  Also,
  982.     noted above is "typical" usage for the IRQ lines in a PC.  From
  983.     the research that I have done, the usage seems to vary.  So, its
  984.     difficult to say exactly what is going on.  IRQ 00 and IRQ 01 are
  985.     used as stated above as a standard, and the same appears to hold
  986.     true for IRQ 3 (COM 2) and IRQ 4 (COM 1).  But, for some of the
  987.     other IRQ lines the usage seems to be depended upon which book
  988.     you read.
  989.  
  990.     What we gain from the table above is that if you have a serial mouse
  991.     on COM 2 most likely the IRQ line that it is using is #3.  Likewise,
  992.     if your mouse is on COM 1, it is probably using IRQ 4.  Microsoft bus
  993.     mice usually use IRQ 5, and some IBM PS/2's use IRQ 12 for the mouse.
  994.  
  995.     Now that you are armed with some memory mapping software and have
  996.     an approximate idea of the IRQ usage on the PC, you can now try
  997.     to determine which IRQ the mouse is using.  It would be best to
  998.     boot up the system loading only DOS and the mouse driver before
  999.     you start hunting for the mouse IRQ.  Rebooting the system is an
  1000.     important to step since it will strip out all the unnecessary TSR's
  1001.     and device drivers.  Failure to do this may result in an unclear
  1002.     picture of the interrupts that the mouse driver is using since another
  1003.     TSR or device driver may be using some of the interrupts used by the
  1004.     mouse driver.  When two TSR's use the same interrupt, the memory
  1005.     mapping software will report that the interrupt is pointing to the
  1006.     last TSR in memory that uses it.
  1007.  
  1008.     It sounds complicated, but essentially all that is required to find
  1009.     out which interrupt vectors are pointing to the mouse driver and used
  1010.     the table above to determine which IRQ line is used by the mouse.
  1011.     The memory mapping software should report an IRQ vector between
  1012.     2 and 15 from the table above pointing to your mouse driver along
  1013.     with int 33h, probably int 08 (IRQ 00), possibly int 09h (IRQ 01), and
  1014.     maybe a few others.  The interrupts used by the mouse driver depend
  1015.     upon the mouse.  So, its impossible to state which interrupts will
  1016.     be used.
  1017.  
  1018.     Again note that a memory mapper will probably show the software
  1019.     interrupts pointing to the mouse driver.  So, you'll have to use the
  1020.     table above to determine the IRQ line that you want to use with VGAsave.
  1021.  
  1022.     For an example, the interrupt usage on my system when booting up
  1023.     with just command.com and the mouse driver is as follows:
  1024.  
  1025.      PSP  bytes  owner    command line      hooked vectors
  1026.     ----- -----  -------- ----------------  ---------------
  1027.     0008  10816  config
  1028.     0DFD  4704   command                    22 24 2E DB E5 E8
  1029.     0F29  16896  N/A       N/A              08 0D 10 2F 33
  1030.     134A  576352 free
  1031.  
  1032.     The "PSP" field shows where in memory the "owner" located.  The "bytes"
  1033.     field is the size of the program, and the "hooked vectors" is what we
  1034.     are interested in.  The first entry, config, is what is used by
  1035.     DOS to set up its default drivers, COM, LPT, etc...  So, we ignore
  1036.     that.  The next entry, command, is the kernel of command.com.  Then
  1037.     finally we come to the "N/A" entry which is the mouse driver.  How do
  1038.     I know its the mouse driver -- because I booted the system and loaded
  1039.     only command.com and the mouse driver.  So, there is no doubt that it
  1040.     is the mouse driver.  The reason that you don't see the program name,
  1041.     mouse.com, is that the mouse driver frees its environment block when
  1042.     loading to conserve memory.  VGAsave does the same thing.
  1043.  
  1044.     Now, consider the "hooked vector" field for the mouse driver.  It shows
  1045.     the following:
  1046.  
  1047.         int 08h  ==>  System Clock (IRQ 00)
  1048.         int 0dh  ==>  This is the Mouse IRQ (IRQ 5)
  1049.         int 10h  ==>  Video services
  1050.         int 2fh  ==>  Multiplex interrupt
  1051.         int 33h  ==>  Mouse services
  1052.  
  1053.  
  1054.     Since int 0dh indicates IRQ 5 and it falls in the range of 2 to 15,
  1055.     that is the interrupt that VGAsave will use for the mouse intercept.
  1056.     Don't confuse this with int 33h.  Int 33h is used at the software level.
  1057.     For example, a program that needs to know the location of the mouse
  1058.     pointer when you click the mouse would make an int 33h call.
  1059.  
  1060.     Once the mouse IRQ has been determined, you are ready to use the
  1061.     /mirq switch with VGAsave.
  1062.  
  1063.  
  1064.     /mirq switch usage
  1065.     ------------------
  1066.  
  1067.     IMPORTANT!!!
  1068.       No warranty is written or implied with VGAsave especially
  1069.       with the usage of the /mirq switch.  You are accessing the
  1070.       system on a very low level at this point.  Failure to use
  1071.       this switch properly may result in a serious system crash.
  1072.       BE CAREFUL!!!  If this bothers you, abort the process now
  1073.       and contact somebody that has experience in these matters or
  1074.       contact the manufacturer of your mouse for an updated driver.
  1075.  
  1076.  
  1077.  
  1078.     To manually specify the IRQ that VGAsave is to use for the mouse
  1079.     the /mirq switch can be used at start up.  Note that the /mirq switch
  1080.     can only be used when VGAsave is initially loaded into memory.  You cannot
  1081.     change the IRQ number without first removing VGAsave from memory.
  1082.  
  1083.     Syntax:
  1084.  
  1085.         VGAsave /mirq:[IRQ_num]
  1086.  
  1087.     Where IRQ_num ranges from 2 to 15.
  1088.  
  1089.     Note that IRQ 0 and IRQ 1 are not valid here since it makes no sense
  1090.     to hook either with the /mirq switch.  Recall that IRQ 0 is the system
  1091.     clock.  Hence, if VGAsave was launched with /mirq:00, the screen would
  1092.     never blank if the mouse was enabled since 18.2 times a second VGAsave's
  1093.     internal time count would be set to zero.  In other words, VGAsave will
  1094.     behave as if you were constantly moving the mouse.  IRQ 1 is invalid
  1095.     since hooking this interrupt is redundant.  IRQ 1 is already used by
  1096.     VGAsave to detect keyboard action and to implement the hot key.
  1097.  
  1098.     For the example above with my bus mouse, it was determined from the
  1099.     memory map that the mouse uses IRQ 5.  Hence, the proper syntax would be
  1100.  
  1101.         VGAsave /mirq:5
  1102.  
  1103.     This will bypass the autodetection of the mouse IRQ in VGAsave and set
  1104.     the IRQ to #5 for the mouse.  If you were now to reboot the system
  1105.     loading just command.com, the mouse driver, and VGAsave /mirq:5, you
  1106.     would see int 0dh pointing to VGAsave and not the mouse driver.  This
  1107.     concept is explained below in the section "Removing VGAsave from Memory".
  1108.     In a nutshell, int 0dh points at VGAsave and VGAsave points at the mouse
  1109.     driver.
  1110.  
  1111.     For another example, if you determined that your mouse is using
  1112.     IRQ 2, the proper syntax would be:
  1113.  
  1114.         VGAsave /mirq:2
  1115.  
  1116.  
  1117.     What VGAsave Does with the Mouse IRQ or what if you use the wrong IRQ?
  1118.     ----------------------------------------------------------------------
  1119.  
  1120.     In flow chart form, the mouse intercept in VGAsave works as follows:
  1121.  
  1122.  
  1123.            +------------+
  1124.         no | Is Mouse   |
  1125.      +-----| Enabled?   |
  1126.      |     +------------+
  1127.      |           |
  1128.      |           | yes
  1129.      |          \|/
  1130.      |     +------------+       +------------------+
  1131.      |     | Is VGAsave | yes   | Set the internal |
  1132.      |     | enabled?   |-----> | time count to 0  |
  1133.      |     +------------+       +------------------+
  1134.      |       |                           |
  1135.      |       | no                        |
  1136.      |       |                          \|/
  1137.      |       |           no     +------------------+
  1138.      |       |     +------------| Is screen blank? |
  1139.      |       |     |            +------------------+
  1140.      |       |     |                     |
  1141.      |       |     |                     |  yes
  1142.      |       |     |                     |
  1143.      |       |     |                    \|/
  1144.      |       |     |            +------------------+
  1145.      |       |     |    +-------|  Unblank screen  |
  1146.      |       |     |    |       +------------------+
  1147.     \|/     \|/   \|/  \|/
  1148.   +-----------------------+
  1149.   |  jmp to original IRQ  |
  1150.   +-----------------------+
  1151.  
  1152.  
  1153.     So, basically 3 steps:
  1154.  
  1155.         1.  Is Mouse enabled?
  1156.             A.  If not absolutely nothing happens.  VGAsave passes control
  1157.                 to the original IRQ vector which points to the mouse driver.
  1158.             B.  If true, VGAsave checks to see if the screen saver is
  1159.                 enabled.
  1160.  
  1161.         2.  Is VGAsave enabled?
  1162.             A.  If not, nothing happens again.  VGAsave passes control
  1163.                 to the original IRQ vector.
  1164.             B.  If true, VGAsave sets its internal time count to 0 which
  1165.                 involves moving a zero into the resident data segment.
  1166.  
  1167.         3.  Is the screen blank?
  1168.             A.  If not, nothing more happens.  VGAsave hands control
  1169.                 over to the original IRQ vector.
  1170.             B.  If true, VGAsave unblanks the screen.  This is done
  1171.                 by directly sending the command out to the VGA card
  1172.                 with "in" and "out" instructions.
  1173.  
  1174.  
  1175.     Thus, if you hook VGAsave to the wrong IRQ by mistake, your system
  1176.     integrity should not be corrupted.  Most likely what will happen is that
  1177.     VGAsave will act a bit strange.  One possibility is that VGAsave will
  1178.     unblanking the screen without the user hitting a key or moving the mouse.
  1179.     The other is that VGAsave will refuse to blank the screen since its
  1180.     internal time count is getting set to zero.  Both symptoms could appear
  1181.     "randomly" depending upon which IRQ you link VGAsave too.
  1182.  
  1183.     Just as a test, I hooked my copy of VGAsave to IRQ 6 (Floppy disk) using
  1184.     /mirq:6.  No, the system didn't crash when I did a dir on a:.  But, what
  1185.     did happen is that accessing the floppy caused the screen to unblank
  1186.     which could be demonstrated with the following test:
  1187.  
  1188.        C:>vgasave /now<ctrl-T>dir a:
  1189.  
  1190.     If your not using DOS 5 and cannot use the ctrl-T command line
  1191.     separator, a batch file can be used.  Since it survived a dir command,
  1192.     the "acid test" sort to speak was to copy a file from the hard disk
  1193.     to the floppy and read it back.  So, I do the following:
  1194.  
  1195.        C:>vgasave /now<ctrl-T>copy vgasave.asm a:
  1196.  
  1197.     The result was that the screen was unblanked during the file copy
  1198.     since I was hooked to IRQ 6 and that the file copied fine.
  1199.  
  1200.     So, if you get confused and give VGAsave the wrong IRQ, everything should
  1201.     be okay.  But, I am *NOT* guaranteeing it.  IRQ usage is system
  1202.     dependent.  Hooking the COM port which has the modem on my system may not
  1203.     cause a crash, but it could on yours.  So, be careful.  Based on the
  1204.     analysis of what VGAsave does when it gets the mouse IRQ, everything
  1205.     should be safe.  But, its impossible to bank on that.  Again, BE CAREFUL!
  1206.  
  1207.     The best way I think to tell if you have given VGAsave the correct IRQ
  1208.     number with the /mirq switch is to start VGAsave with the IRQ number
  1209.     desired then hit the hot key to blank the screen.  Now nudge the mouse if
  1210.     the screen unblanks, all is well.
  1211.  
  1212.     Now if you are curious, here is what the memory map of my system looks
  1213.     like loading just command.com the mouse driver (mouse.com) and
  1214.     VGAsave /mirq:5.  Note that the memory map shown below would be the same
  1215.     if I did not use /mirq:5 on start up since VGAsave properly detects the
  1216.     IRQ that my mouse is using.  Thus, in my situation, starting VGAsave
  1217.     with /mirq:5 makes no difference whatsoever.
  1218.  
  1219.  
  1220.      PSP  bytes owner    command line     hooked vectors
  1221.     ----- ----- -------- ---------------  -------------------
  1222.     0008  10816 config
  1223.     0DFD   4704 command                   22 24 2E DB E5 E8
  1224.     0F29  16896 N/A       N/A             08 33
  1225.     134A    400 N/A       N/A             09 0D 10 1C 2F
  1226.     1361  575984 free
  1227.  
  1228.     Note that VGAsave is the "400 N/A" line in the memory map and that
  1229.     int 0dh (IRQ 5) is pointing to VGAsave.
  1230.  
  1231.     Determining which mouse switch to use
  1232.     -------------------------------------
  1233.  
  1234.     1.  If VGAsave is in your autoexec.bat, use a rem statement so
  1235.         that VGAsave will not be loaded during boot up.
  1236.  
  1237.     2.  Reboot the system.
  1238.  
  1239.     3.  Start VGAsave from the command line.
  1240.  
  1241.     4.  If VGAsave reports that function 36 is not supported by the current
  1242.         mouse driver, the /mirq switch is required.  If this is the case,
  1243.         abort the test and determine which IRQ your mouse is using.  Then
  1244.         go to step 12.
  1245.  
  1246.     5.  Use the hot key or issue VGASave /now to blank the screen.
  1247.  
  1248.     6.  Move the mouse.
  1249.  
  1250.     7.  If the screen does *not* come back on, the /mirq switch is required
  1251.         even if VGAsave does not report that mouse function 36 is not
  1252.         supported .  If this is true, abort the test at this point and
  1253.         determine which IRQ line your mouse is using.  Then go to step 12.
  1254.  
  1255.     8.  Start some application that uses the mouse, such as the dosshell.
  1256.  
  1257.     9.  Use the hot key to blank the screen.
  1258.  
  1259.    10.  Move the mouse.  If the screen does not come back on, the /int33
  1260.         switch is required.
  1261.  
  1262.    11.  If the screen is restored in step 10, exit the application and try
  1263.         step 10 again.  The situation with mouse driver is not 100% clear
  1264.         since its impossible to predict the behavior of each and every mouse
  1265.         driver.  So, you may have to try several applications repeating steps
  1266.         10 and 11 before VGAsave will not recognize the mouse.
  1267.  
  1268.    12.  Note:  You should be using the /mirq switch if you get to this point.
  1269.         A.  Reboot the system.
  1270.         B.  Start VGAsave with the appropriate /mirq switch.
  1271.         C.  Do step 5 and step 6.  The screen should come back on when you
  1272.             move the mouse.  If it doesn't then you have the wrong IRQ for
  1273.             your mouse.
  1274.         D.  Do steps 8, 9, 10, and 11 above.
  1275.         E.  If the screen does not come back on in step 10 and/or 11, you
  1276.             need to use the /int33 switch along with the /mirq switch when
  1277.             starting VGAsave.
  1278.         F.  Add the appropriate command line switches to VGAsave in your
  1279.             autoexec.bat, remove the rem statement, and reboot.
  1280.  
  1281.  
  1282.     Mouse switch summary
  1283.     ====================
  1284.  
  1285.     /int33
  1286.         This switch may only be used during start up and directs VGAsave to
  1287.         install the interrupt 33h hook.  Should not be used unless necessary
  1288.         since this switch will increase the resident memory requirement of
  1289.         VGAsave to 448 bytes.  However, if memory usage is not an issue, this
  1290.         command may be used unconditionally.
  1291.  
  1292.     /mirq:[irq_num]  where  [irq_num] = 2 to 15
  1293.         Manual override for the mouse IRQ line.  This command bypasses the
  1294.         autodetection of the mouse IRQ line that VGAsave uses during start up.
  1295.         Does not increase the resident memory requirement of VGAsave, and may
  1296.         be used unconditionally when given the correct IRQ number.
  1297.  
  1298.     Removing VGAsave from Memory
  1299.     ============================
  1300.  
  1301.     VGAsave can be removed from memory with the /r command line switch
  1302.     or by selecting the "R" option from the interactive menu.  Note that
  1303.     VGAsave or any TSR for that matter can only be removed from memory if
  1304.     all the captured interrupts are currently pointing at it.  This usually
  1305.     means that it has to be loaded last.  If the TSR is not loaded last,
  1306.     then it is possible that it cannot be removed from memory.  VGAsave will
  1307.     detect this condition and refuse to remove itself from memory if all
  1308.     hooked interrupts are not currently pointing to the resident code.  In
  1309.     this case the only way to remove VGAsave from memory is to reboot the
  1310.     system.  However, keep in mind that VGAsave can always be disabled via
  1311.     the /off switch if it cannot be removed from memory.
  1312.  
  1313.     The reason for this is that when a TSR is removed from memory all the
  1314.     hooked interrupts must be restored to their original state for the
  1315.     PC to continue to function properly.  If one of the hooked interrupts
  1316.     no longer points to the TSR's resident code, then the TSR has no means
  1317.     to restore the proper vector to the interrupt table.  Consider the
  1318.     following to illustrate the point:
  1319.  
  1320.     Before Loading VGAsave            After loading VGAsave
  1321.  
  1322.         +-----------+                  +------------+
  1323.         |   TSR 1   |                  |    TSR 1   |
  1324.         +-----------+                  +------------+
  1325.              /|\                             /|\
  1326.               |                               |
  1327.               | Int X                         |  Int X
  1328.               |                               |
  1329.         +-----------+                   +-----------+
  1330.         | Int Table |                   |  VGAsave  |
  1331.         +-----------+                   +-----------+
  1332.                                              /|\
  1333.                                               |
  1334.                                               |  Int X
  1335.                                               |
  1336.                                         +-----------+
  1337.                                         | Int Table |
  1338.                                         +-----------+
  1339.  
  1340.  
  1341.     Before loading VGAsave assume that some TSR, TSR 1, is loaded in memory
  1342.     and has some interrupt (call it Int X) pointing at TSR 1 that is
  1343.     used by VGAsave.  In this case, the interrupt vector points directly
  1344.     to TSR 1 as shown above on the left.  When VGAsave is loaded,
  1345.     VGAsave make a copy of the int X vector and saves it as resident data.
  1346.     VGAsave then updates the interrupt table via an int 21h call
  1347.     so that int X points to VGAsave.  Hence, the interrupt table points to
  1348.     VGAsave, and VGAsave points to TSR 1 to form a chain as shown above on
  1349.     the right.  Thus, whenever int X is issued, control is passed to VGAsave,
  1350.     and VGAsave passes control to TSR 1.  When VGAsave is removed from
  1351.     memory, int X is restored back to its original vector using the
  1352.     data stored within VGAsave's resident data block to update the interrupt
  1353.     table via an int 21h call.  This operation then restores the PC back
  1354.     to its original state before VGAsave was loaded (figure on the left).
  1355.  
  1356.     Now consider the case when another TSR, TSR 2, is loaded after VGAsave
  1357.     as shown below.
  1358.  
  1359.                         +-----------+
  1360.                         |   TSR 1   |
  1361.                         +-----------+
  1362.                              /|\
  1363.                               |
  1364.                               |  Int X
  1365.                               |
  1366.                         +-----------+
  1367.                         |  VGAsave  |
  1368.                         +-----------+
  1369.                              /|\
  1370.                               |
  1371.                               |  Int X
  1372.                               |
  1373.                         +-----------+
  1374.                         |   TSR 2   |
  1375.                         +-----------+
  1376.                              /|\
  1377.                               |
  1378.                               |  Int X
  1379.                               |
  1380.                         +-----------+
  1381.                         | Int Table |
  1382.                         +-----------+
  1383.  
  1384.  
  1385.     In this case, the interrupt table points to TSR 2, TSR 2 points to
  1386.     VGAsave, and VGAsave points to TSR 1.  Hence, when int X is issued,
  1387.     control is passed to TSR 2, TSR 2 passes control to VGAsave, and
  1388.     VGAsave passes control to TSR 1.  If VGAsave were to be removed from
  1389.     memory under these conditions, the interrupt chain would become corrupted
  1390.     as shown below.
  1391.  
  1392.  
  1393.                               +-----------+
  1394.                               |   TSR 1   |
  1395.                               +-----------+
  1396.                                    /|\
  1397.                                     |
  1398.                                     +---------------+
  1399.        +--------+                                   |
  1400.        |  Free  |             +-----------+         |
  1401.        | Memory |<----------- |   TSR 2   |         |   int X
  1402.        +--------+             +-----------+         |
  1403.                                                     |
  1404.                                     +---------------+
  1405.                                     |
  1406.                               +-----------+
  1407.                               | Int Table |
  1408.                               +-----------+
  1409.  
  1410.  
  1411.     TSR 2 gets completely bypassed since VGAsave points to TSR 1 and that
  1412.     is the interrupt vector that gets restored to the interrupt table when
  1413.     VGAsave is removed from memory.  Thus, TSR 2 will no longer be part of
  1414.     the interrupt chain, and the interrupt vector stored within TSR 2 points
  1415.     to where VGAsave was which is now free memory.
  1416.  
  1417.     Note that in the event that VGAsave is not loaded last and can be
  1418.     remove from memory, beware that a "hole" will remain in DOS memory where
  1419.     VGAsave was residing since DOS cannot "pack" the pc's memory.  This
  1420.     idea gets involved with DOS memory allocation strategy which I'm not
  1421.     very familiar with.   Considering that we're only talking about 400 bytes
  1422.     of memory, this isn't a major concern.
  1423.  
  1424.  
  1425.     Memory Requirements/Loading VGAsave High
  1426.     ========================================
  1427.  
  1428.     The resident memory requirement of the VGAsave is 400 bytes.  Extended
  1429.     or expanded memory is not required.  VGAsave supports DOS 5.0 Upper
  1430.     Memory Blocks (UMB) when the loadhigh command is used.  Personally,
  1431.     I've run into some difficulties with loading TSR's high occasionally.
  1432.     So, if you are loading VGAsave high and its not working properly, try
  1433.     loading it in base memory before you decide that the software is buggy.
  1434.     Since the UMBs are fixed in size, sometimes you have to juggle the
  1435.     order in which you load TSR's to get them all to fit properly.  Don't
  1436.     ask me why.  This has just been my experience.  Keep in mind that all
  1437.     is not lost if you have to load VGAsave in base memory since it only
  1438.     requires 400 bytes of memory.
  1439.  
  1440.  
  1441.     Technical info
  1442.     ==============
  1443.  
  1444.     This section is intended to provide a general feeling for how VGAsave
  1445.     works and covers some of the common questions that I have encountered.
  1446.     It is by no means a complete discussion on TSR design.  One could
  1447.     easily write a book on that topic.
  1448.  
  1449.     VGAsave was written in assembler and employs direct access techniques
  1450.     to keep the size of the resident code small.  In particular, VGAsave
  1451.     directly accesses the VGA card to blank and restore the screen.  Thus,
  1452.     VGAsave WILL ONLY WORK ON VGA SYSTEMS.  The other direct access technique
  1453.     employed is the direct manipulation of the BIOS keyboard buffer area
  1454.     which is described below.
  1455.  
  1456.  
  1457.  
  1458.     Interrupts hooked:
  1459.  
  1460.     (Also see the section, "Mouse Problems" above.)
  1461.  
  1462.        int 09h:  Keyboard hardware interrupt
  1463.        =====================================
  1464.  
  1465.        The hot key is implemented by hooking int 09h (kbd hardware int i.e.
  1466.        IRQ 01) and directly manipulating the BIOS keyboard buffer area to
  1467.        avoid making a call to BIOS from within the resident code.  A call
  1468.        to BIOS from within a TSR requires reserving stack space within the
  1469.        resident code for BIOS to use which increases the amount of memory
  1470.        required by the TSR significantly.
  1471.  
  1472.        In essence, what happens here is that every time a key is pressed or
  1473.        released an int 09h is issued by the keyboard so that the PC can
  1474.        detect and process keystrokes.  VGAsave takes advantage of this by
  1475.        hooking this interrupt to keep track of keyboard activity and to
  1476.        implement the hot key feature.
  1477.  
  1478.        Whenever an int 09h occurs, control is passed to VGAsave, and VGAsave
  1479.        makes a copy of the current BIOS keyboard buffer tail (the BIOS
  1480.        keyboard buffer is a circular buffer) and then calls the BIOS ISR
  1481.        (interrupt service routine) for the keyboard (int 09h) as a subroutine.
  1482.        After the BIOS ISR is called, control is returned to VGAsave, and the
  1483.        new keyboard buffer tail is compared to the old one.  If they are
  1484.        different, then a valid BIOS keystroke occurred.  This solves the
  1485.        problem of differentiating between key presses and releases both of
  1486.        which cause int 09h to occur.  If a keystroke is detected, the
  1487.        VGAsave reads the scan code directly from the BIOS keyboard buffer.
  1488.        By reading the scan code directly from the BIOS keyboard buffer, an
  1489.        int 16h call is not required which eliminates the need to reserve
  1490.        stack space within the resident code for the int 16h call.
  1491.  
  1492.        Once VGAsave obtains a keystroke, it is compared to the hot key
  1493.        scan code stored within VGSsave's resident code.  If a match is found,
  1494.        the VGAsave blanks the screen and removes the keystroke from
  1495.        the BIOS keyboard buffer.  If no match is found and the screen is
  1496.        blanked, VGAsave restores the screen, sets its internal time
  1497.        count to zero, and suppresses the keystroke.  The final possibility is
  1498.        that VGAsave does not detect its hotkey and the screen is not blanked.
  1499.        In this case, VGAsave sets its internal time count to zero and does
  1500.        not suppress the keystroke.
  1501.  
  1502.        Removing the keystroke from the BIOS keyboard buffer is accomplished
  1503.        by restoring the keyboard buffer tail back to its value before the
  1504.        BIOS int 09h ISR was invoked.  This is why a valid BIOS keystroke is
  1505.        required to restore a blanked screen, a scan code must be generated by
  1506.        BIOS for VGAsave to detect a keystroke.  If no hot key is selected,
  1507.        the hot key scan code used by VGAsave is set to 00h, and the int 09h
  1508.        ISR inside VGAsave remains active.
  1509.  
  1510.        NOTE:   Due to the direct manipulation of the BIOS keyboard buffer
  1511.                area, an incompatibility may occur between VGAsave and
  1512.                some keyboard buffer extension programs since the extended
  1513.                keyboard buffer is held some other place in memory.  However,
  1514.                extended buffers usually don't start stacking up keystrokes
  1515.                until the default BIOS keyboard buffer is full.  Hence, under
  1516.                normal circumstances, an extended keyboard buffer shouldn't
  1517.                cause any problem.  A problem could occur when the BIOS keyboard
  1518.                buffer spills over into the extended buffer.  In this case, if
  1519.                you try to blank the screen via the hot key, VGAsave has
  1520.                no means to detect or suppress the keystroke since it doesn't
  1521.                know where to look for the keystroke.  This leaves you with an
  1522.                extra alt-0 (or which ever hot key you are using) stuck in the
  1523.                extended keyboard buffer which may or may not be a problem
  1524.                when it is eventually processed by BIOS.  If this extra
  1525.                keystroke is a problem, I have two recommendations both of
  1526.                which accomplish the same thing:
  1527.  
  1528.                    1.  Don't use the hot key to blank the screen if you
  1529.                        have a large number of keystrokes waiting to be
  1530.                        processed.
  1531.                    2.  Disable the hot key support with "VGAsave /key:none"
  1532.                        or selecting "none" from the interactive menu.
  1533.  
  1534.  
  1535.        int 10h:  BIOS Video services
  1536.        =============================
  1537.  
  1538.        Used by VGAsave to keep the screen blanked once the selected
  1539.        time has passed even if a program is running which switches
  1540.        video modes via int 10h, service 00h.  Int 10h, service 00h
  1541.        forces most (if not all) of the registers on a VGA card to
  1542.        become re-initialized when the video mode is changed.  This will
  1543.        cause a blanked screen to be restored.  This causes no harm, but
  1544.        without hooking this interrupt VGAsave will not reblank the screen
  1545.        since it does not have a means to detect that the screen has been
  1546.        been turned back on.  In other words, VGAsave would act as if the
  1547.        screen is blank even though it isn't without the int 10h hook.
  1548.        Thus, VGAsave would appear as if it quit working if the video mode
  1549.        is changed while the screen is blanked.  The other side effect that
  1550.        would occur without hooking int 10h is that once the screen comes back
  1551.        on due to a video mode change, the next key that is pressed will be
  1552.        suppressed by VGAsave since VGAsave thinks that the screen was blanked
  1553.        and needs to be restored.  Its a subtle point.  But it can be an
  1554.        irritant if you are running something that switches video modes such
  1555.        as, CAD packages.
  1556.  
  1557.  
  1558.        int 1ch:   User timer tick
  1559.        ==========================
  1560.  
  1561.        Used by VGAsave to keep track of the time that has elapsed since
  1562.        a keystroke or a mouse movement.  Note that this interrupt occurs
  1563.        18.2 times a second.  So if you use VGAsave /s, VGAsave may
  1564.        report a time out that off by a second or two due to round off
  1565.        error.  The reason for this is that the time out value provided
  1566.        by the user gets multiplied by 18.2 before being saved in the
  1567.        resident data block since the user provides a time out in seconds.
  1568.        Then when VGAsave /s is used to retrieve this value from the
  1569.        resident data block, it has to be divided by 18.2 in order for
  1570.        VGAsave to return the value in seconds.  These two operations
  1571.        are preformed by VGAsave using integer arithmetic i.e. the number
  1572.        of seconds are multiplied by 182 then divided by 10 to get system
  1573.        timer ticks and the reverse process is used to get the number of
  1574.        seconds from the number of timer ticks.  Hence, round off error
  1575.        becomes a possibility.
  1576.  
  1577.        int 2fh:   Multiplex Interrupt
  1578.        ==============================
  1579.  
  1580.        VGAsave hooks interrupt 2fh as a means for communication between
  1581.        the resident code and the transient code.  It is this hook which
  1582.        provides VGAsave the ability to change hot key, to remove itself
  1583.        from memory, to perform an installation check, etc.
  1584.  
  1585.        In order to understand how VGAsave handles this, it is necessary
  1586.        to first have a feeling for how an int 2fh hook works.  A TSR
  1587.        is a program which has two parts, a resident part and a transient
  1588.        part.  It is the resident part of the TSR which stays in memory
  1589.        after the program has terminated, and the transient part which takes
  1590.        care of initializing the TSR and communication with the resident
  1591.        portion.  Hence, the next time that the TSR is executed, the transient
  1592.        portion will detect that the TSR is already resident in memory and
  1593.        allow the user to communicate with the resident code.  An int 2fh hook
  1594.        can be used to accomplish this task.  A signature or id byte is assigned
  1595.        to the TSR which is placed in ah before calling int 2fh and al is set
  1596.        to 00h.  Typically, when the resident code finds its signature in ah,
  1597.        it will return ffh in al to denote that it is resident in memory and
  1598.        whatever other information is necessary for the transient part of the
  1599.        code to communicate with it.  So far, so good.  But, a problem arises
  1600.        when two or more TSR's use the same signature.  In that case, one TSR
  1601.        may attempt to communicate with another which will result in disaster
  1602.        since the two programs will be structured differently.
  1603.  
  1604.        VGAsave employs a more sophisticated installation check to avoid this
  1605.        problem.  During start up, VGAsave looks for an unused int 2fh
  1606.        signature starting with 0c0h and ranging to 0ffh.  Signatures
  1607.        below 0c0h are not considered since they are reserved by Microsoft.
  1608.        The search is accomplished by loading ah with the signature in
  1609.        question and al with 00h then calling int 2fh.  If any non-zero
  1610.        value is returned in al by the int 2fh call, VGAsave assumes that
  1611.        that the signature in ah is currently being used.  Once VGAsave finds
  1612.        a free signature, VGAsave will save the signature in the resident
  1613.        portion of the program and load into memory.  If VGAsave cannot find
  1614.        a free signature, it will report an error and refuse to load.  With
  1615.        this approach, VGAsave is not locked into using a fixed multiplex
  1616.        signature and can adapt itself to its environment.
  1617.  
  1618.        Note that the signature detection approach used by VGAsave conforms
  1619.        to the standard usage for this interrupt.   As stated the int 2fh
  1620.        is called with the signature in ah, and 00h in al.  The data in al
  1621.        can be though of as the function number 0 for the TSR using the
  1622.        signature in ah.  The standard usage for service 00h is an install
  1623.        check.  If a TSR is hooked to int 2fh, when its signature is placed
  1624.        in ah with al equal to zero, the TSR should return ffh in al to denote
  1625.        that it is installed.  This fact is very important for VGAsave
  1626.        to detect a free signature.  If there is a TSR loaded in memory that
  1627.        does not return a non-zero value in al for an install check, VGAsave
  1628.        will think that the signature it has made the int 2fh call with is
  1629.        not being used.  VGAsave will then use this signature for itself.  What
  1630.        happens now is that there is two TSR's using the same multiplex
  1631.        signature and there will be a conflict.  This conflict can cause
  1632.        both VGAsave and the other TSR to misbehave.  The symptoms for VGAsave
  1633.        could be something like you can't control it once its loaded (i.e.
  1634.        turn it off, etc.), VGAsave loads itself more than once in memory
  1635.        because its resident data/code is getting corrupted and it can't
  1636.        recognize itself in memory, or in the worst case the system may crash.
  1637.        The reason these possibilities exist is that VGAsave may intercept the
  1638.        other TSR's data/commands as its own on an int 2fh call and the
  1639.        resident code will become corrupted.  Unfortunately, it is impossible
  1640.        to predict every non-standard usage of the int 2fh install check
  1641.        function.  Hence, the solution to this problem is to change the
  1642.        order in the autoexec.bat that your TSR's are loaded and hope that
  1643.        this will resolve the conflict.
  1644.  
  1645.        Once VGAsave is resident in memory and VGAsave is run again to
  1646.        take advantage of one of its options, a means must be provided for
  1647.        VGAsave to figure out what multiplex signature it is using.  This
  1648.        is accomplished in an almost identical manner.  A loop is set up
  1649.        to make int 2fh calls starting with 0c0h in ah ranging to 0ffh with
  1650.        al set to 00h.  Once VGAsave finds an int 2fh call that returns a
  1651.        non-zero value in al, it assumes that it has found the resident
  1652.        portion of VGAsave.  If it has actually found the resident portion
  1653.        of VGAsave, the bx register will contain the resident code segment.
  1654.        The trick here is that the transient portion of VGAsave doing
  1655.        the multiplex signature check has a copy of the resident code along
  1656.        with it.  Hence, to verify that the multiplex signature belongs
  1657.        to VGAsave, VGAsave compares the resident code to the copy of it
  1658.        in the transient portion.  If a match is found, then VGAsave knows
  1659.        that it has the correct multiplex signature.  If no match is found,
  1660.        VGAsave keeps looking.  The comparison used checks the first 38 bytes
  1661.        of the resident code which in effect gives VGAsave a 38 byte
  1662.        identification string with using any additional memory.
  1663.  
  1664.        There is one possible conflict that can occur with this approach.
  1665.        VGAsave grabs a mux signature that is used by some other TSR.  In
  1666.        this case, load VGAsave after the TSR causing problems.  VGAsave
  1667.        will detect that particular multiplex signature is being used, and
  1668.        VGAsave will use a different one.
  1669.  
  1670.        The int 2fh hook is also used to make VGAsave windows aware.  In
  1671.        essence, when windows loads, it issues an int 2fh call (the init
  1672.        broadcast).  VGAsave catches the init broadcast via the int 2fh
  1673.        hook and disables itself.  Likewise, when windows is closed, windows
  1674.        makes an exit broadcast with int 2fh.  VGAsave "listens" for the exit
  1675.        broadcast and re-enables itself.
  1676.  
  1677.        Mouse Hardware interrupt
  1678.        ========================
  1679.  
  1680.        The mouse intercept is achieved detecting the presence of the mouse
  1681.        by calling int 33h, service 00h.  The reason that this approach
  1682.        has been implemented in version 1.93 was that it has been found
  1683.        that some older mouse drivers need to be reset before the
  1684.        hardware will start issuing the IRQ when a mouse event occurs.
  1685.  
  1686.        Once the presence of the mouse is determined, the mouse hardware
  1687.        interrupt (i.e. IRQ number) is determined with a call to function 36d
  1688.        to the mouse driver (i.e. int 33h, service 36d).  The IRQ number is
  1689.        then translated to its corresponding software interrupt vector that
  1690.        processes the hardware interrupt so that VGAsave can link up with the
  1691.        mouse.  For example,  I have a Microsoft Bus Mouse on IRQ 5.  Hence,
  1692.        whenever something is done with the mouse, the PC is signaled by the
  1693.        mouse issuing a signal to the PIC (Programmable Interrupt Controller)
  1694.        on the mother board via request line #5.  The PIC then tells the CPU
  1695.        that an interrupt or IRQ has occurred.  The CPU then issues the
  1696.        appropriate *software* interrupt *instruction* (int 0dh for IRQ 5)
  1697.        which causes the mouse driver to spring into action.  This sequence
  1698.        repeats every time the mouse is moved or a button is pushed.  Thus,
  1699.        in essence, all the IRQ is doing is telling the mouse driver that
  1700.        something is going on with the mouse.  Its then up to the mouse
  1701.        driver to extract the data from the mouse hardware to see what the
  1702.        mouse is doing.  Since VGAsave doesn't care what the mouse is doing
  1703.        only that something is being done with the mouse, hooking the mouse
  1704.        IRQ line is a good way for VGAsave to link up with the mouse.
  1705.  
  1706.        For IRQ 5 in the example above as noted, via the PIC an IRQ 5 causes
  1707.        an int 0dh to occur.  Hence, VGAsave will hook interrupt 0dh. Then
  1708.        whenever IRQ 5 occurs, int 0dh occurs, and whatever program is
  1709.        currently running is suspended, VGAsave detects the mouse event then
  1710.        passes control to the mouse driver which passes control back to the
  1711.        suspended program when it is done.
  1712.  
  1713.        Thus, by hooking the mouse hardware interrupt, any mouse event (button
  1714.        presses, releases, motion, etc.) can be detected by VGAsave and are used
  1715.        to reset the internal time count to zero and restore the screen if it is
  1716.        blanked.
  1717.  
  1718.        Int 33h:  Mouse Services
  1719.        ========================
  1720.  
  1721.        This hook is only present if VGAsave is started with the /int33
  1722.        switch.  The purpose is to allow VGAsave to work with mouse drivers
  1723.        that re-point the mouse IRQ vector to the directly to the mouse driver
  1724.        as part of the int 33h service without preserving the interrupt chain.
  1725.        The architecture of this hook is outlined in the section on "Mouse
  1726.        Problems" above.
  1727.  
  1728.  
  1729.     Author
  1730.     ======
  1731.  
  1732.     If you have any comments or suggestions, I may be reached via internet
  1733.     e-mail at javurek@msen.com.  If you send mail, please mention VGAsave
  1734.     in the subject header.
  1735.  
  1736.     As noted in the readme file, its getting difficult to thoroughly test
  1737.     all the possible combinations of command line switches, etc.  Every
  1738.     effort has been made to insure that this software is as bug free as
  1739.     possible, but a few may have slipped by.  If you do encounter a bug,
  1740.     please send me mail so that I can keep track of the problems that users
  1741.     are experiencing.
  1742.  
  1743.     Mail indicating that you are not having any problems and that you like
  1744.     the program is always welcome.  I've spent quite a bit of time on this
  1745.     project and it is nice to know that somebody besides me and a few other
  1746.     folks are using VGAsave.
  1747.  
  1748.     If you're wondering, no the source code is not available.  If you're
  1749.     not wondering then forget I mentioned it.
  1750.  
  1751.  
  1752.     Acknowledgements
  1753.     ================
  1754.  
  1755.     I would like to thank Tim Emmerich for his suggestions and beta testing.
  1756.  
  1757.     I'd also like to thank all the people who sent e-mail and helped me sort
  1758.     out the difficulties associated with the mouse in version 1.91 and
  1759.     provided suggestions for version 2.00.
  1760.  
  1761.  
  1762.